const express = require('express')
const app = express()
app.use(express.json())
app.use(require('cors')())

//引入文件
//基础型
var login = require('./router/basicType/login') //zhong
var register = require('./router/basicType/register') //zhong
//获取型
var getDepartmentInfo = require('./router/getType/getDepartmentInfo'); //zhong
var getStationInfo = require('./router/getType/getStationInfo'); //zhong
var getEmployees = require('./router/getType/getEmployees') //zzz
var getTrainInfo = require('./router/getType/getTrainInfo') //zzz 
var getAttendanceInfo = require('./router/getType/getAttendanceInfo') //zzz
var getProjectInfo = require('./router/getType/getProjectInfo') //zhao
var getStationChangeInfo = require('./router/getType/getStationChangeInfo') //zhong
var getAccessInfo = require('./router/getType/getAccessInfo') //zhao
var getProjectEmployeesInfo = require('./router/getType/getProjectEmployees') //zhao
var getUser = require('./router/getType/getUser') //zhao
var getSalaryChangeInfo = require('./router/getType/getSalaryChangeInfo') //zhao
var getCurrentUserInfo = require('./router/getType/getCurrentUserInfo') //zhong
//增型
var addEmployee = require('./router/addType/addEmployee') //zzz 
var addAttendanceInfo = require('./router/addType/addAttendanceInfo') //zhao
var addTrain = require('./router/addType/addTrain') //zzz 
var addDepartment = require('./router/addType/addDepartment') // zhong
var addStation = require('./router/addType/addStation') // zhong 
var addProject = require('./router/addType/addProject') // zhao
//删型
var deleteEmployee = require('./router/deleteType/deleteEmployee') // zzz 
var deleteDepartment = require('./router/deleteType/deleteDepartment') // zhong
var deleteStation = require('./router/deleteType/deleteStation')// zhong
var deleteProject = require('./router/deleteType/deleteProject')//zhao
var deleteUser = require('./router/deleteType/deleteUser')//zhao
//修改型
var updateSalary = require('./router/updateType/updateSalary') //zzz  未写
var updateStation = require('./router/updateType/updateStation') //zzz  
var updateAccess = require('./router/updateType/updateAccess') // zhao
var updatePassword = require('./router/updateType/updatePassword') //zhong 

//基础型
app.use('/api',login)
app.use('/api',register)
//获取型
app.use('/api',getDepartmentInfo)
app.use('/api',getStationInfo)
app.use('/api',getEmployees)
app.use('/api',getTrainInfo)
app.use('/api',getStationChangeInfo)
app.use('/api',getAttendanceInfo)
app.use('/api',getProjectInfo)
app.use('/api',getAccessInfo)
app.use('/api',getProjectEmployeesInfo)
app.use('/api',getUser)
app.use('/api',getSalaryChangeInfo)
app.use('/api',getCurrentUserInfo)
//增型
app.use('/api',addAttendanceInfo)
app.use('/api',addDepartment)
app.use('/api',addEmployee)
app.use('/api',addProject)
app.use('/api',addStation)
app.use('/api',addTrain)
//删型
app.use('/api',deleteDepartment)
app.use('/api',deleteEmployee)
app.use('/api',deleteProject)
app.use('/api',deleteStation)
app.use('/api',deleteUser)
//修改型
app.use('/api',updateSalary)
app.use('/api',updateStation)
app.use('/api',updateAccess)
app.use('/api',updatePassword)

//跨域监听
app.listen(3000, ()=> {
    console.log('http://localhost:3000')
})
